package lwj;

public class Student {
    String name;
    int id;
    double money; //全部补助
    int i; //实验室数量
    Lab[] labs = new Lab[5]; //一堆实验室
    final double tax = 0.3; //一个不变的税率
    final double tax2 = 0.4;
    final double tax3 = 0.1;

    public Student(String name,int id){
        this.name = name;
        this.id = id;
    }

    //给学生添加实验室
    public void add_lab(Lab lab){
        labs[i] = lab;
        i++;
    }

    //计算全部所得钱数
    public void cal_money(){
        int[] a = new int[18];
        for (int i = 0;i< labs.length;i++){
            if (labs[i] == null){
                continue;
            }
            else {
                a = labs[i].getScore().getResult(); //分数数组  18个数字是数组
                for(int j=0;j<18;j++){
                    if(a[j]<=5){ //5分以下及格
                        money = money + Lab.pass;
                        System.out.println(j+1 +"周收入:" +money);
                    }
                    else if(a[j]>7){ //7分以上优秀
                        money = money + Lab.great;
                        System.out.println(j+1 +"周收入:" +money);
                    }
                    else{  //其余良好
                        money = money + Lab.good;
                        System.out.println(j+1 +"周收入:" +money);
                    }
                }
            }
        }
        System.out.println("总共收入" + money);
    }

	public void cal_tax() {	
	}
}